<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="./template.xhtml">

    <ui:define name="title">
        DataExporter - <span class="subitem">Exclude Columns</span>
    </ui:define>

    <ui:define name="description">
        Particular columns can be excluded in exported document.
    </ui:define>

    <ui:param name="documentationLink" value="/components/dataexporter" />

    <ui:define name="implementation">

        <h:form>
            <p:dataTable id="tbl" var="car" value="#{dataExporterView.cars}" 
                         paginator="true" rows="10">
                <p:column>
                    <f:facet name="header">
                        <h:outputText value="Id" />
                    </f:facet>
                    <h:outputText value="#{car.id}" />
                </p:column>

                <p:column exportable="false">
                    <f:facet name="header">
                        <h:outputText value="Year" />
                    </f:facet>
                    <h:outputText value="#{car.year}" />
                </p:column>

                <p:column>
                    <f:facet name="header">
                        <h:outputText value="Brand" />
                    </f:facet>
                    <h:outputText value="#{car.brand}" />
                </p:column>

                <p:column exportable="false">
                    <f:facet name="header">
                        <h:outputText value="Color" />
                    </f:facet>
                    <h:outputText value="#{car.color}" />
                </p:column>
            </p:dataTable>

            <h:commandLink id="excel">
                <p:graphicImage name="/demo/images/excel.png" />
                <p:dataExporter type="xls" target="tbl" fileName="cars" />
            </h:commandLink>

            <h:commandLink id="pdf">
                <p:graphicImage name="/demo/images/pdf.png" />
                <p:dataExporter type="pdf" target="tbl" fileName="cars" />
            </h:commandLink>

            <h:commandLink id="csv">
                <p:graphicImage name="/demo/images/csv.png" />
                <p:dataExporter type="csv" target="tbl" fileName="cars" />
            </h:commandLink>

            <h:commandLink id="xml">
                <p:graphicImage name="/demo/images/xml.png" />
                <p:dataExporter type="xml" target="tbl" fileName="cars" />
            </h:commandLink>
        </h:form>
        
    </ui:define>

</ui:composition>
